package manager;

import entity.Book;
import iface.IManagerDisabled;
import java.util.ArrayList;

/**
 *
 * @author Noi
 */
public class DisabledBookManager implements IManagerDisabled<Book> {

    private ArrayList<Book> alBook;
    private Manager manager;

    public DisabledBookManager() {
        this.alBook = new ArrayList<Book>();
    }

    @Override
    public void add(Book obj) {
        this.alBook.add(obj);
    }

    @Override
    public void recovery(int index) {
        Book book = (Book) this.alBook.remove(index);
        book.setStatus(true);
        this.manager.getBookManager().add(book);
    }

    @Override
    public Book get(int index) {
        return this.alBook.get(index);
    }
}
